package bdqn.t09.controller;

import bdqn.t09.service.AsCustomsService;
import bdqn.t09.util.Pageinfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Controller
public class agentCustomerManagementController {

    @Resource
    private AsCustomsService asCustomsService;

    @RequestMapping("goAgentManagement")
    public String goAgentManagement(){
        return "agentManagement";
    };

    @RequestMapping("portalZiLianJie")
    public String goPortalManage(){
        return "portalManage";
    };

    @RequestMapping("addCustoms")
    public String goInsertCustoms(){
        return "insertCustoms";
    };

    // 去到系统管理下的关键字审核
    @RequestMapping("goDeywordAudit")
    public String goKeywordAudit(){
        return "keywordAudit";
    }

    // 分页查询
    @ResponseBody
    @RequestMapping("asCustomsServiceShow")
    public Object find(@RequestParam(defaultValue = "1")Integer page,
                       @RequestParam(defaultValue = "10") Integer rows,String customname){
        Pageinfo pageinfo = asCustomsService.selectAsAccountdetailMapper(customname, page, rows);
        Map map =new HashMap();
        map.put("rows",pageinfo.getList());
        map.put("total",pageinfo.getCount());
        return map;
    }
}
